/**
 * Created by Sultan Imanhodjaev.
 * User: sultan
 * Date: 3/24/11
 * Time: 6:49 PM
 */

$(document).ready(function() {
    var st = {}

    $('.link-tools, #id_add_link img').mouseover(function() {
        var p = $(this).attr('src');
        var r = $(this).attr('rel');

        $(this).attr('src', p.replace('color', 'grey'));

        st['td[rel="' + r + '"]'] = $('td[rel="' + r + '"]').css('background')

        $('td[rel="' + r + '"]').css({
            'background': '#CAF01A',
            'text-decoration': 'underline'
        });
    }).mouseout(function() {
        var p = $(this).attr('src');
        var r = $(this).attr('rel');

        $(this).attr('src', p.replace('grey', 'color'));

        st[r] = $('td[rel="' + r + '"]').css('background')

        $('td[rel="' + r + '"]').css({
            'background': st[r],
            'text-decoration': 'none'
        });
    });

    $('.accordion-tip').accordion({
        'active': 0,
        'collapsible': true,
        'clearStyle': true,
        'icons': {
            'header': 'ui-icon-circle-triangle-s',
            'headerSelected': 'ui-icon-circle-triangle-n'
        }
    });

    $('.ui-accordion').css({
        'width': 390
    });
});
